<template>
	<view>

		<view class="play0">
			<!-- <view class="zh">账号和隐私</view> -->

			<view class="play2" @click="Quit">退出账号</view>


		</view>

	</view>
</template>


<script>
	export default {
		data() {
			return {
				userInfos: {
					nickname: '登录',
					pictureUrl: 'https://lnu-market.oss-cn-guangzhou.aliyuncs.com/2022-10-06/16:22:29-8b47bee75ce5400792163d304d21f7b4.jpg',

				}


			}

		},
		methods: {
			Quit() {
				let userInfo = this.userInfos
				// 询问用户是否退出登录	
				uni.showModal({
					title: '提示',
					content: '确认退出登录吗？',
					success: function(res) {
						if (res.confirm) {
							// 用户确认了退出登录的操作
							uni.removeStorageSync("userInfo");
							uni.removeStorageSync("nickname");
							uni.removeStorageSync("avatarUrl");
							uni.setStorageSync('userInfo', userInfo);
							uni.removeStorageSync("changeNum");
							uni.setStorageSync('changeNum', '1');
							uni.removeStorageSync("token");
							uni.removeStorageSync("id");
							uni.setStorageSync('id', '00');
							uni.switchTab({
								url: '/pages/my/my',
								success: () => {
									uni.showToast({
										title: '退出成功',
										duration: 2000
									});

								},
							});

						} else if (res.cancel) {

						}
					}
				});







			}
		}
	}
</script>

<style>
	.zh {
		margin-top: 16rpx;
		text-indent: 16rpx;
	}


	.play {
		display: flex;
		background-color: #ffffff;
		justify-content: space-between;
		align-items: center;
		padding: 0 32rpx;
		border-bottom: 1rpx solid #e0e0e0;
	}

	.play1 {
		margin: 1upx 10rpx;
		line-height: 140rpx;
		text-align: left;
		color: #777;
		font-size: 32rpx;

	}

	.play2 {
		margin: 1upx 10rpx;
		line-height: 140rpx;
		text-align: left;
		color: #777;
		font-size: 32rpx;
		text-indent: 24rpx;
		background-color: #ffffff;
		border-bottom: 1rpx solid #e0e0e0;

	}

	.background {
		display: flex;
	}

	.uni-list-cell-db {
		width: 500px;
	}

	.ll1 {
		align-items: flex-end;
	}
</style>
